home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Library / Manuels & Misc / Boundschecker / Bounds Checker C++.TXT < prev    next >
Encoding:
Text File  |  2000-05-25  |  12.0 KB  |  559 lines

  1.  
  2.  
  3. BoundsChecker 5.01
  4.  
  5. C++Builder Edition
  6.  
  7.  
  8.  
  9. ReadMe File
  10.  
  11.  
  12.  
  13.  
  14.  
  15. Contents:
  16.  
  17.  
  18.  
  19. * Reporting Problems And Suggestions
  20.  
  21. * Installation Prerequisites
  22.  
  23. * Installation
  24.  
  25. * If You Have A Previous Version Of BoundsChecker On Your System
  26.  
  27. * Removing An Installation
  28.  
  29. * Known Anomalies 
  30.  
  31. * Technical Notes
  32.  
  33. * Using BoundsChecker With Visual Test 4.0
  34.  
  35.  
  36.  
  37.  
  38.  
  39. Reporting Problems and Suggestions
  40.  
  41. ----------------------------------
  42.  
  43.  
  44.  
  45. Technical Support is available by e-mail at tech@numega.com or by 
  46.  
  47. calling Technical Support at 603-578-8100. You can also fax us at 603-
  48.  
  49. 578-8401 (attention: Technical Support).
  50.  
  51.  
  52.  
  53. Problem reports should include:
  54.  
  55.  
  56.  
  57. - System Configuration (CPU, RAM, OS, compiler, IDE)
  58.  
  59. - Detailed problem description (include exact error message text)
  60.  
  61. - How to reproduce problem
  62.  
  63. - Whether you are compiling from IDE or command line
  64.  
  65. - Options used in compiling and linking
  66.  
  67. - Your error detection mode (Normal, Maximum, or Custom)
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75. Installation Prerequisites
  76.  
  77. --------------------------
  78.  
  79.  
  80.  
  81. * PC-compatible Intel 486 system or above
  82.  
  83. * Microsoft Windows NT 3.51 or 4.0
  84.  
  85. * Microsoft Windows 95
  86.  
  87. * RAM: 32 MB minimum, 48 MB recommended
  88.  
  89. * Disk: 12 MB for full installation
  90.  
  91. * IDE integration requires Borland C++ Builder 1.0 or later
  92.  
  93. * Complete debugger integration (Smart Debugging) requires Borland 
  94.  
  95. C++ Builder 1.0 or later.
  96.  
  97.  
  98.  
  99.  
  100.  
  101. Installation
  102.  
  103. ------------
  104.  
  105.  
  106.  
  107. To install BoundsChecker, insert the CD into your CD-ROM drive. Close 
  108.  
  109. any programs that may be running. With Windows 95 or Windows NT 4.0, use 
  110.  
  111. the Add/Remove Programs Control Panel. With Windows NT 3.51, use Program 
  112.  
  113. Manager or File Manager to run setup.exe.
  114.  
  115.  
  116.  
  117.  
  118.  
  119. If You Have A Previous Version Of BoundsChecker On Your System
  120.  
  121. --------------------------------------------------------------
  122.  
  123.  
  124.  
  125. BoundsChecker32/NT or BoundsChecker for Windows 95: BCHK32NT and/or 
  126.  
  127. BCHK32C must not appear in the path before the BoundsChecker directory. 
  128.  
  129. If they do, BoundsChecker may crash or fail to detect errors because it 
  130.  
  131. is trying to load obsolete libraries from the earlier product.
  132.  
  133.  
  134.  
  135. BoundsChecker 3.x: BoundsChecker 5.0 cannot be installed along with an 
  136.  
  137. installation of BoundsChecker 3.x (you will no longer be able to use 
  138.  
  139. your 3.x installation). If, after installing BoundsChecker 5.0, you need 
  140.  
  141. to use BoundsChecker 3.x, remove BoundsChecker 5.0 using the provided 
  142.  
  143. un-install utility, then re-install BoundsChecker 3.x.
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151. Removing An Installation
  152.  
  153. ------------------------
  154.  
  155.  
  156.  
  157. To remove this product, run the Remove BoundsChecker program item.
  158.  
  159.  
  160.  
  161. "Remove" performs these steps:
  162.  
  163.  
  164.  
  165. - Removes BoundsChecker registry entries
  166.  
  167. - Removes BoundsChecker-specific Visual Test registry entries
  168.  
  169. - Deletes the BoundsChecker program folder and items
  170.  
  171.  
  172.  
  173. NOTES:
  174.  
  175. - Files that you created after installation (for example, Help system .GID files) 
  176.  
  177. will not be removed automatically.
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185. Known Anomalies
  186.  
  187. ---------------
  188.  
  189.  
  190.  
  191. --- BoundsChecker inadvertently reports an access violation error in the 
  192.  
  193. Program Error Detected window if the application writes to its resource data. 
  194.  
  195. This error report typically occurs once for each page of virtual memory 
  196.  
  197. containing written resource data.
  198.  
  199.  
  200.  
  201. --- Due to a known problem in Windows95, it is possible to crash the 
  202.  
  203. operating system when halting a program from the BoundsChecker Program 
  204.  
  205. Error Detected window. Windows NT handles this situation properly, 
  206.  
  207. however, Windows95 does not. The problem occurs when an application 
  208.  
  209. calls ExitProcess (which BoundsChecker does to halt the application) and 
  210.  
  211. one of the DLLs used by the application brings up a message box during 
  212.  
  213. its DLL_PROCESS_DETACH processing sequence. To prevent this error 
  214.  
  215. condition, avoid making any calls to MessageBox during your 
  216.  
  217. DLL_PROCESS_DETACH processing.
  218.  
  219.  
  220.  
  221. --- Due to SmartHeap memory manager usage, it is possible, however 
  222.  
  223. unlikely, that BoundsChecker will report false overruns of dynamically 
  224.  
  225. allocated memory. In order to use BoundsChecker with the memory manager 
  226.  
  227. provided with SmartHeap/HeapAgent, you must add the following lines to 
  228.  
  229. the DEFAULT.DAT file, located in the BoundsChecker DATA directory (these 
  230.  
  231. are the functions that overload malloc, calloc, realloc and free):
  232.  
  233.               _MEM_malloc           ID  011
  234.  
  235.               _MEM_calloc           ID  015
  236.  
  237.               _MEM_free             ID  019
  238.  
  239.               _MEM_realloc          ID  022
  240.  
  241.  
  242.  
  243. Once you have edited DEFAULT.DAT, BoundsChecker will keep track of the 
  244.  
  245. heap correctly; both HeapAgent and BoundsChecker will be able to report 
  246.  
  247. errors to you. 
  248.  
  249.  
  250.  
  251. --- BoundsChecker reports leakage when processing DLL_PROCESS_DETACH. 
  252.  
  253. Since the order in which modules are unloaded cannot be controlled, 
  254.  
  255. erroneous leakage reports can result when a DLL unloads after 
  256.  
  257. BoundsChecker. This can occur when the following conditions are met:
  258.  
  259. - user DLL allocates memory in DLL_PROCESS_ATTACH
  260.  
  261. - user DLL frees the allocated memory in DLL_PROCESS_DETACH
  262.  
  263. - BoundsChecker unloads before the user DLL
  264.  
  265.  
  266.  
  267. --- In some rare instances, BoundsChecker may falsely report an 
  268.  
  269. incorrect number of arguments for sprintf functions for optimized code. 
  270.  
  271. Use Suppress to prevent a false report on later runs.
  272.  
  273.  
  274.  
  275. --- Certain OLE interface methods, as implemented in some existing 
  276.  
  277. applications, will return the error code E_NOTIMPL ("not implemented"), 
  278.  
  279. although the OLE documentation indicates that this is not an acceptable 
  280.  
  281. return code for these methods.  This is the list of methods for which 
  282.  
  283. this sometimes occurs:
  284.  
  285.  
  286.  
  287.  IOleInPlaceObject::ContextSensitiveHelp
  288.  
  289.  IOleInPlaceObject::ReactivateAndUndo
  290.  
  291.  IOleObject::GetMoniker
  292.  
  293.  IViewObject2::Freeze
  294.  
  295.  
  296.  
  297. Note that BoundsChecker will notify you of this error even if you are 
  298.  
  299. running in Quick or Normal mode, or have unchecked the 'Check for OLE 
  300.  
  301. "not implemented" return code errors' option in Custom mode.  This is 
  302.  
  303. because we base our OLE error checking on documented OLE behavior.
  304.  
  305.  
  306.  
  307. --- OLE errors reported in OLE system DLLs:  In certain circumstances 
  308.  
  309. BoundsChecker can report errors on OLE interface method calls that are 
  310.  
  311. made inside system OLE DLLs such as OLE32.DLL and OLEAUT32.DLL.  These 
  312.  
  313. errors are only reported in normal and maximum mode and are always OLE 
  314.  
  315. return failure errors.  The reason these errors are reported is because 
  316.  
  317. an interface, that was created and hooked by BoundsChecker, was passed 
  318.  
  319. to an API function and that API is using it.  Since the interface was 
  320.  
  321. created in the user's program, we still monitor it for error detection 
  322.  
  323. even if it is inside a system DLL.
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333. Technical Notes
  334.  
  335. ---------------
  336.  
  337.  
  338.  
  339. --- Debugging an NT service: Using the Registry Editor, go to 
  340.  
  341. HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS NT\CurrentVersion\. Create 
  342.  
  343. a new key called "Image File Execution Options". Under this key, create 
  344.  
  345. a subkey with the name of your service. For example, MYSERV.EXE. To this 
  346.  
  347. subkey, add a REG_SZ value called Debugger. For the Debugger value, 
  348.  
  349. enter the path to the BoundsChecker program (e.g., 
  350.  
  351. C:\BChecker\BC.EXE). Exit the Registry Editor. Start up the Control 
  352.  
  353. Panel, and double-click on the 'Services' icon. Highlight your service 
  354.  
  355. to be checked. Click the 'Startup...' button. In the dialog box that 
  356.  
  357. appears, select the 'Allow Service to Interact with Desktop' button. 
  358.  
  359. Click OK. If you don't do these steps, BoundsChecker will run, but will 
  360.  
  361. be invisible. At the main Control Panel | Services dialog, start your 
  362.  
  363. service. BoundsChecker should appear, with the service already opened. 
  364.  
  365. At this point, you can set any desired options and then run the service 
  366.  
  367. via BoundsChecker. If your service starts automatically during NT's 
  368.  
  369. bootup, use the Control Panel to set the 'Interact with desktop' 
  370.  
  371. attribute, and then restart the machine. BoundsChecker should start 
  372.  
  373. automatically when the service is started. (IMPORTANT NOTE: This only 
  374.  
  375. works with Windows NT 3.51, or later versions!)
  376.  
  377.  
  378.  
  379. --- Automatically invoking BoundsChecker when a program is executed 
  380.  
  381. (Windows NT only): You would use this if the program is invoked by some 
  382.  
  383. other process, and you want to run BoundsChecker on this program. NOTE: 
  384.  
  385. This works only on Windows NT, and will not work on Windows 95. As 
  386.  
  387. always, be careful whenever you edit the registry. Using REGEDT32:
  388.  
  389. 1 Select the key
  390.  
  391.   HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion
  392.  
  393. 2 Under the selected key, add the following KEY, if it does not exist:
  394.  
  395.   Image File Execution Options
  396.  
  397. 3 Under "Image File Execution Options" add this KEY:
  398.  
  399.   FOO.EXE
  400.  
  401.   (where FOO.EXE is the name of the program you want to test.)
  402.  
  403. 4 Under the "FOO.EXE" key add a new VALUE:
  404.  
  405.   Value name: Debugger
  406.  
  407.   Data type:  REG_SZ
  408.  
  409.   String:     c:\Bchecker\bc.exe
  410.  
  411.   (Where the string value is the full pathname for BoundsChecker on your 
  412.  
  413. machine.)
  414.  
  415.  
  416.  
  417. --- Startup performance and alternate DEFAULT.DAT files: If your program 
  418.  
  419. takes an unusually long time to start under BoundsChecker, you may want 
  420.  
  421. to use one of the alternate DEFAULT.DAT files shipped with 
  422.  
  423. BoundsChecker. First, backup your existing copy of DEFAULT.DAT by 
  424.  
  425. renaming DEFAULT.DAT (in the BoundsChecker DATA directory) to 
  426.  
  427. DEFAULT.BAK. Then, copy one of the alternate DEFAULT.xxx files to 
  428.  
  429. DEFAULT.DAT:
  430.  
  431. Microsoft C/C++ (includes Symantec)   DEFAULT.MSC
  432.  
  433. Borland C/C++ (include Watcom)        DEFAULT.BOR
  434.  
  435. Borland Object Pascal (Delphi 2.X)     DEFAULT.DPH
  436.  
  437. All of the above                      DEFAULT.ALL
  438.  
  439. NOTE: This is done automatically for you by the Setup program, based on 
  440.  
  441. your compiler choice.
  442.  
  443.  
  444.  
  445. IMPORTANT: If you need to change or add support for additional compilers 
  446.  
  447. after installing BoundsChecker, make sure to run Setup to install the 
  448.  
  449. appropriate DEFAULT.DAT file (or copy the appropriate file/files as 
  450.  
  451. described above).
  452.  
  453.  
  454.  
  455. --- Heap exceptions when running under a debugger in Windows NT 3.51: 
  456.  
  457. When an application is debugged, the Windows NT memory management APIs 
  458.  
  459. throw exceptions when bad parameters are detected. BoundsChecker uses 
  460.  
  461. some of these APIs to perform parameter validation, which can cause 
  462.  
  463. these exceptions to be thrown. At the request of many beta testers, we 
  464.  
  465. now disable the Windows NT debug heap during Smart Debugging. If you 
  466.  
  467. wish to re-enable the debug heap when using Smart Debugging, change the 
  468.  
  469. following registry value to 0.
  470.  
  471.  
  472.  
  473.     HKEY_CURRENT_USER
  474.  
  475.         \Software
  476.  
  477.             \Microsoft
  478.  
  479.                 \Developer
  480.  
  481.                     \BoundsChecker
  482.  
  483.                         \DisableHeapException
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493. Using BoundsChecker With Visual Test 4.0
  494.  
  495. ----------------------------------------
  496.  
  497.  
  498.  
  499. When using the BoundsChecker with Visual Test, make sure that your 
  500.  
  501. scripts wait for BoundsChecker to completely finish so all text is 
  502.  
  503. properly sent to your BoundsCheckerNotification handler.  If the script 
  504.  
  505. ends before BoundsChecker is finished, some error notifications might 
  506.  
  507. not get through.  This is especially true with memory and resource leaks 
  508.  
  509. since the application being tested must completely end before they can 
  510.  
  511. be reported.
  512.  
  513.  
  514.  
  515. Here are two methods to make sure your script does not end prematurely:
  516.  
  517.  
  518.  
  519. 1 In the test script, following the commands to close the application 
  520.  
  521. being tested, add a long enough sleep statement to allow BoundsChecker 
  522.  
  523. to get all the information over to the notification handler (You may 
  524.  
  525. need to use a value greater than the 60 used here).
  526.  
  527. ...
  528.  
  529. WSysMenu ( 0 )
  530.  
  531. WMenuSelect ( "&Close" )
  532.  
  533. Sleep ( 60 )
  534.  
  535. End
  536.  
  537. ...
  538.  
  539.  
  540.  
  541. 2 If the script is run interactively, a Pause statement will display a 
  542.  
  543. message box and wait until the OK button is pressed before the script 
  544.  
  545. will continue.
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553. -----------------------------------------------------------------
  554.  
  555. Copyright 1997 NuMega Technologies, Inc.
  556.  
  557. 04/97
  558.